From: Owen Taylor Date: Mon, 3 Nov 2008 20:33:14 +0000 (+0000) Subject: Work around libmozjs not being in ld.so.conf on Ubuntu X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~11614 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=39184955e5b51a6f4b9d4ec4a7f60e2a52cd0cf9;p=gnome-shell.git Work around libmozjs not being in ld.so.conf on Ubuntu In our jhbuildrc, add the path containing libmozjs.so on Ubuntu to to LD_LIBRARY_PATH. The path is heuristically derived from pkg-config output. svn path=/trunk/; revision=26 --- diff --git a/tools/build/jhbuildrc-gnome-shell b/tools/build/jhbuildrc-gnome-shell index f120b1d53..8a1cd9160 100644 --- a/tools/build/jhbuildrc-gnome-shell +++ b/tools/build/jhbuildrc-gnome-shell @@ -37,6 +37,23 @@ addpath('XDG_DATA_DIRS', '/usr/share') # Look in /etc/xdg for system-global autostart files addpath('XDG_CONFIG_DIRS', '/etc/xdg') +# +# For Ubuntu Intrepid, libmozjs lives in /usr/lib/xulrunner-/lib +# However, that path isn't in ld.so.conf, meaning that it's basically +# impossible to use the xulrunner .pc files and libraries. Work around +# this by deriving the path and adding it to LD_SO_CONF ourself. +# +import re +import subprocess +_pkgconfig = subprocess.Popen(['pkg-config', '--variable=sdkdir', 'mozilla-js'], + stdout=subprocess.PIPE) +_sdkdir = _pkgconfig.communicate()[0].strip() +_pkgconfig.wait() +if _pkgconfig.returncode == 0: + _libdir = re.sub('-(sdk|devel)', '', _sdkdir) + '/lib' + if os.path.exists(_libdir + '/libmozjs.so'): + addpath('LD_LIBRARY_PATH', _libdir) + # Rebuild faster os.environ['INSTALL'] = os.path.expanduser('~/bin/install-check')